package com.hdoit.ares.web.insu.modelconfig;

import com.hdoit.ares.web.insu.providers.InsuranceStateProvider;
import com.hdoit.ares.web.insu.providers.InsuranceStatusProvider;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      caochengmeng
 * @email       
 * @createtime  2017年11月04日 10:30:52
 * @comment
 */
public class InsuranceProviderConfig extends ModelMetadataAttributeConfiguration{
    public InsuranceProviderConfig(){
        this.setProperty("name")
            .hasAttribute(new DisplayNameAttribute("产品名称"))
            .hasAttribute(new RequiredAttribute("产品名称为必填项"));

        this.setProperty("minPremium")
            .hasAttribute(new DisplayNameAttribute("最低保费"))
            .hasAttribute(new RequiredAttribute("最低保费为必填项"));

        this.setProperty("insuranceType")
            .hasAttribute(new DisplayNameAttribute("险种"))
            .hasAttribute(new RequiredAttribute("险种为必填项"));

        this.setProperty("status")
            .hasAttribute(new DisplayNameAttribute("新品/热卖"))
            .hasAttribute(new RequiredAttribute("新品/热卖为必填项"))
            .hasAttribute(new DropDownListAttribute(new InsuranceStatusProvider()));

        this.setProperty("spreadProportion")
            .hasAttribute(new DisplayNameAttribute("推广比例"));

        this.setProperty("shareProportion")
            .hasAttribute(new DisplayNameAttribute("分享比例"));

        this.setProperty("manageProportion")
            .hasAttribute(new DisplayNameAttribute("管理比例"));

        this.setProperty("mainImg")
            .hasAttribute(new DisplayNameAttribute("主图"));

        this.setProperty("addImg")
            .hasAttribute(new DisplayNameAttribute("产品附加图"));

        this.setProperty("state")
            .hasAttribute(new DisplayNameAttribute("产品状态"))
            .hasAttribute(new RequiredAttribute("产品状态为必填项"))
            .hasAttribute(new DropDownListAttribute(new InsuranceStateProvider()));

        this.setProperty("securityPlan")
            .hasAttribute(new DisplayNameAttribute("保障计划"));

        this.setProperty("createManagerName")
            .hasAttribute(new DisplayNameAttribute("创建人姓名"));

        this.setProperty("modifyManagerName")
            .hasAttribute(new DisplayNameAttribute("修改人姓名"));

        this.setProperty("code")
            .hasAttribute(new DisplayNameAttribute("按字母搜索"));

        this.setProperty("markCode")
            .hasAttribute(new DisplayNameAttribute("按汉字搜索"));

    }
}